<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{
			margin: 0px;
			padding:0px;
			font-family: "微软雅黑"
		}
		.box{
			margin-top: 100px;
			width: 100%;
			height: 50px;
			background: #01204F url() 0 0 no-repeat;
		}
		.box .mid{
			width: 1090px;
			height: 50px;
			margin: 0 auto;
			position: relative;
			/*background: red url() 0 0 no-repeat;*/
		}
		.box .mid ul{
			position: relative;
			z-index: 999;
		}
		.box .mid ul li{
			list-style: none;
			float: left;
			padding: 0 15px;
			cursor: pointer;

		}
		.box .mid ul li.first{
			background: #CC0000 url() 0 0 no-repeat;
		}
		.box .mid ul li a{
			text-decoration: none;
			color: #fff;
			line-height: 50px;
			font-size: 16px;
			font-weight: 800;	
		}
		.bg{
			width: 10px;
			height: 50px;
			background: #CC0000 url() 0 0 no-repeat;
			position: absolute;
			top: 0px;
			left: 0px;
			z-index: 100;
		}

	</style>
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script type="text/javascript">

		$(function  () {
			
			$('.list').mouseover(function() {
				listwidth = $(this).width();
				listLeft = $(this).position().left;
				$('.bg').stop().animate({left: listLeft+'px',width: listwidth+30+"px"}, 300);
			});
			$('.mid ul').mouseleave(function(event) {
				$('.bg').animate({left:'0px',width:'62px'}, 500);
			});

		})

	</script>
</head>
<body>
	<div class="box">
		<div class="mid">
			<ul>
				<li class="list first"><a href="">首页</a></li>
				<li class="list"><a href="">百家</a></li>
				<li class="list"><a href="">新闻者</a></li>
				<li class="list"><a href="">军事</a></li>
				<li class="list"><a href="">财经新闻</a></li>
				<li class="list"><a href="">百家</a></li>
				<li class="list"><a href="">新闻者</a></li>
				<li class="list"><a href="">军事</a></li>
				<li class="list"><a href="">财经新闻</a></li>
				<li class="list"><a href="">百家</a></li>
				<li class="list"><a href="">新闻者</a></li>
				<li class="list"><a href="">军事</a></li>
				<li class="list"><a href="">财经新闻</a></li>
			</ul>
			<div class="bg"></div>
		</div>
	</div>
</body>
</html>